import React, { PureComponent,Fragment } from 'react';
import {RecommendWrapper,RecommendItem} from '../sytle';
import { connect } from 'react-redux';

class Recommend extends PureComponent {
    render() {
        return (
            <Fragment>
                <RecommendWrapper>
                    {
                        this.props.list.map((item)=>{
                            return(
                                <RecommendItem imgUrl={item.get('imgUrl')} key={item.get('id')}>
                                </RecommendItem>
                            )
                        })
                    }
                </RecommendWrapper>
            </Fragment>
        )
    }
}

const mapState = (state)=>({
    list: state.getIn(['home','recommendList'])
})

export default connect(mapState,null)(Recommend);